/*
 * This file is part of LangMan.
 *
 * LangMan is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * LangMan is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with LangMan.  If not, see <http://www.gnu.org/licenses/>.
 */

package langman.business.data;

import langman.business.data.model.Category;
import langman.business.data.model.Key;
import langman.business.data.model.Language;

public class LanguageServiceEvent {
    private final LanguageServiceEventType type;
    private final Object target;

    private LanguageServiceEvent(LanguageServiceEventType type, Object target) {
        this.type = type;
        this.target = target;
    }

    public Object getTarget() {
        return target;
    }

    public LanguageServiceEventType getType() {

        return type;
    }

    public static LanguageServiceEvent languageAdded(Language language) {
        return new LanguageServiceEvent(LanguageServiceEventType.LanguageAdded, language);
    }

    public static LanguageServiceEvent languageRemoved(Language language) {
        return new LanguageServiceEvent(LanguageServiceEventType.LanguageRemoved, language);
    }

    public static LanguageServiceEvent categoryAdded(Category category) {
        return new LanguageServiceEvent(LanguageServiceEventType.CategoryAdded, category);
    }

    public static LanguageServiceEvent categoryRemove(Category category) {
        return new LanguageServiceEvent(LanguageServiceEventType.CategoryRemoved, category);
    }

    public static LanguageServiceEvent keyAdded(Key key) {
        return new LanguageServiceEvent(LanguageServiceEventType.KeyAdded, key);
    }

    public static LanguageServiceEvent keyRemoved(Key key) {
        return new LanguageServiceEvent(LanguageServiceEventType.KeyRemoved, key);
    }
}
